package com.hanserwei.han_picture.domain.entity.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 空间用户关联表
 */
@Schema(description = "空间用户关联表")
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "space_user")
public class SpaceUser implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @Schema(description = "id")
    private Long id;

    /**
     * 空间 id
     */
    @TableField(value = "space_id")
    @Schema(description = "空间 id")
    private Long spaceId;

    /**
     * 用户 id
     */
    @TableField(value = "user_id")
    @Schema(description = "用户 id")
    private Long userId;

    /**
     * 用户在该空间的角色: viewer/editor/admin
     */
    @TableField(value = "space_role")
    @Schema(description = "用户在该空间的角色: viewer/editor/admin")
    private String spaceRole;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time")
    @Schema(description = "更新时间")
    private LocalDateTime updateTime;
}